<template>
   <div class="parent">
       <Parent v-if="parentData.parent" :parentData='parentData.parent'/>
       <div class="top">
           <div class="nickname">{{parentData.user.nickname}}</div>
           <div class="create_date">{{parentData.create_date.slice(0,10)}}</div>
           <div class="reply" @click="replyHandle">回复</div>
       </div>
       <p class="content">
           {{parentData.content}}
       </p>
   </div>
</template>

<script>
import Bus from '@/untails/bus'
export default {
   name:'Parent',
  props:['parentData'],
  methods:{
    replyHandle(){
      Bus.$emit('sendComment',this.parentData.id)
    }
  }
}
</script>


<style lang="less" scoped>
.parent {
    background-color: #ffffee;
  border: 1px solid #aeaeab;
  padding: 3px;
  .top {
      height: 40px;
      display: flex;
      align-items: center;
      padding: 0 10px;
  .nickname {
  font-size: 14px;
  }

  .create_date {
      flex: 1;
font-size: 12px;
color: #ccc;
margin-left: 10px;
  }

  .reply {
    font-size: 14px;
    color: #999;
  }
}

.content {
   padding: 0 10px;
   text-indent: 1.5;
}
}

</style>